package com.chinacoal.microservice.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.chinacoal.microservice.pojo.CcmsSmartleasingExpenseEntry;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 费用管理-费用录入
 * @date 2020-11-27 9：39
 */
public interface CcmsSmartleasingExpenseEntryMapper extends BaseMapper<CcmsSmartleasingExpenseEntry> {

    /**
     * @Description: 查询上个月的水电煤度数
     * @author zhuliang
     * @date 2020/11/27 18:45
     */
    CcmsSmartleasingExpenseEntry getLastmMonth();


    CcmsSmartleasingExpenseEntry getLastMonthMobilityByRoomId(@Param("fkRoomId") String fkRoomId);

    /**
     * @Description: 批量添加
     * @author zhuliang
     * @date 2020/12/3 20:17
     */
    void batchAdd(List<CcmsSmartleasingExpenseEntry> expenseEntryList);

    /**
     * @Description: 根据费用信息id查询本月录入信息和前三月录入的水电煤信息
     * @author zhuliang
     * @date 2020/12/5 10:51
     */
    CcmsSmartleasingExpenseEntry getHydropowerByExpenseManagId(@Param("fkExpenseManagId") String fkExpenseManagId);

    /**
     * 将电梯费置为空
     * @param pkExpenseEntryId
     */
    void updateElevatorFeeToNull(@Param("pkExpenseEntryId") String pkExpenseEntryId);

    /**
     * 将卫生费置为空
     * @param pkExpenseEntryId
     */
    void updateSanitationFeeToNull(@Param("pkExpenseEntryId") String pkExpenseEntryId);

    /**
     * 将本体维修基金置为空
     * @param pkExpenseEntryId
     */
    void updateMaintenanceFundToNull(@Param("pkExpenseEntryId") String pkExpenseEntryId);

    /**
     * 将电视费/煤保置为空
     * @param pkExpenseEntryId
     */
    void updateGasInsuranceToNull(@Param("pkExpenseEntryId") String pkExpenseEntryId);

    CcmsSmartleasingExpenseEntry selectEntryByRoomCode(@Param("roomCode") String roomCode,@Param("yearMth") String yearMth);

    void updateThisMonthEntryDataByPkId(@Param("ee") CcmsSmartleasingExpenseEntry ee);
    CcmsSmartleasingExpenseEntry getMonthMobilityByRoomId(@Param("fkRoomId") String fkRoomId);

}
